﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta content="IE=11.0000" http-equiv="X-UA-Compatible">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="Flat Dark Web Login Form Responsive Templates, Iphone Widget Template, Smartphone login forms,Login form, Widget Template, Responsive Templates, a Ipad 404 Templates, Flat Responsive Templates" />
    <title>登录页面</title>
    <#assign base=request.contextPath/>
    <link rel="stylesheet" href="${base}/backstage/layui/css/layui.css">
    <link href="${base}/backstage/denglu/css/style.css" rel='stylesheet' type='text/css' />
    <script type="text/javascript" src="${base}/backstage/denglu/js/jquery.min.js"></script>
    <script type="text/javascript" src="${base}/backstage/layui/layui.js"></script>


</head>
<body>
<h1>博诺扫码点餐后台管理系统</h1>
<div class="login-form">
    <div class="head-info">
        <label class="lbl-1"> </label>
        <label class="lbl-2"> </label>
        <label class="lbl-3"> </label>
    </div>
    <div class="clear"> </div>
    <div class="avtar"><img src="${base}/backstage/images/logo.png" style="width: 20%"/></div>
    <form>
        <input type="text" class="text" id="account"  onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Username';}">
        <div class="key"><input type="password" id="passWord"  onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}"></div>
    </form>
    <div class="signin"><input type="button" onclick="login()" value="Login"></div>
</div>
<div class="copy-rights">
    <p>Copyright &copy; 2020.博诺扫码点餐后台管理系统</p>
</div>
</body>
<script type="text/javascript">
    $(document).ready(function (c) {
        $('.close').on('click', function (c) {
            $('.login-form').fadeOut('slow', function (c) {
                $('.login-form').remove();
            });
        });
    });
    layui.use(['table', 'form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , $ = layui.jquery
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate
            , table = layui.table;
    })
    function login() {
        if ($("#account").val() == "" || $("#account").val() == null) {
            layui.layer.msg("请输入账户", {icon: 5})
            return;
        }
        if ($("#passWord").val() == "" || $("#passWord").val() == null) {
            layui.layer.msg("请输入密码", {icon: 5})
            return;
        }
        $.ajax({
            type: "POST",
            url: "${base}/admin/user/login",
            data: {
                "account": $("#account").val(),
                "passWord": $("#passWord").val()
            },
            success: function (data) {
                if (data.code === 200) {
                    window.location.href = "${base}/admin/user/index.html"
                }else{
                    layui.layer.msg(data.msg, {icon: 5})
                }

            }
        });
    }
    //键盘事件
    $("body").bind("keydown",function(e){
        // 兼容FF和IE和Opera
        var theEvent = e || window.event;
        var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
        if (code == 13) {
            //回车执行查询
            $("#login").click();
        }
    });
    function shang() {
        window.location.href="${base}/admin/user/user_add.html";
    }
</script>
</HTML>
